<?php 
	$full_name 		= $this->formText('full_name', $this->Item['full_name']);
	$email			= $this->formText('email', $this->Item['email']);
	$title			= $this->formText('title', $this->Item['title']);
	$content		= $this->formTextarea('content', $this->Item['content'], array('id' => 'input_content'));

	$captcha 		= $this->captcha;
	$txtCaptcha 	= $this->formText('captcha','');
	$txtID 			= $this->formHidden('captchaID',$this->captcha_id);
	$urlCaptch		= $this->baseUrl('default/index/captcha-image');
	$inputCaptcha	= $this->formText('captcha',null, array('class' => 'width_240'));
	$submit			= $this->formSubmit('submitMessage', $this->translate('Send'), array('class' => 'button_large'));
?>
	<div class="featured-view">
		<h1>Liên hệ</h1>
      	<div class="contact-form">
      		<div class="contact-left">
	          	<form action="" method="post" name="frm-contact" id="frm-contact">
		          	<div class="box">
		           		<span class="title">Họ và tên: </span>
		              	<?php echo $full_name?>
		              	<?php 
		              		if(!empty($this->errors['full_name'])){
		              			echo '<div class="clr"></div><span class="frm_error">' . $this->errors['full_name'] . '</span>';
		              		}
		              	?>
		         	</div>
		        	<div class="box">
		              	<span class="title">Email: </span>
		              	<?php echo $email?>
		              	<?php 
		              		if(!empty($this->errors['email'])){
		              			echo '<div class="clr"></div><span class="frm_error">' . $this->errors['email'] . '</span>';
		              		}
		              	?>
		          	</div>
		          	<div class="box">
		              	<span class="title">Tiêu đề: </span>
		               	<?php echo $title?>
		               	<?php 
		              		if(!empty($this->errors['title'])){
		              			echo '<div class="clr"></div><span class="frm_error">' . $this->errors['title'] . '</span>';
		              		}
		              	?>
		           	</div>
		          	<div class="box">
		              	<span class="title">Nội dung: </span>
		              	<?php echo $content?>
		              	<?php 
		              		if(!empty($this->errors['content'])){
		              			echo '<div class="clr"></div><span class="frm_error">' . $this->errors['content'] . '</span>';
		              		}
		              	?>
		         	</div>
		         	<div class="box">
		              	<span class="title">Mã captcha: </span>
		              	<?php echo $txtCaptcha?>
		              	<?php 
		              		if(!empty($this->errors['captcha'])){
		              			echo '<div class="clr"></div><span class="frm_error">' . $this->errors['captcha'] . '</span>';
		              		}
		              	?>
		         	</div>
		         	<div class="box">
		              	<div class="border_img captcha"><?php echo $txtID . $captcha?></div>
		              	<div class="refresh" id="refresh"></div>
		         	</div>
		         	<div class="clr"></div>
		           	<div class="box">
		              	<a class="button" href=#"><span>Gửi mail</span></a>
		         	</div>	
		         </form>
		 	</div>       
	     	<div class="info-contact">
				<div class="map">
	              	<div class="border_img"><div id="google_map"></div></div>
	       		</div>
	         	<div class="address">
	             	<h1>Cửa hàng thời trang Bobi Shop</h1>
					<p>23 Đường 1, Khu Phố 4, P.An Phú, Quận 2, TP.Hồ Chí Minh</p>
	             	<p>Điện thoại: 0909.911.922</p>
	              	<p>Email: <a href="mailto:thoitrangbebo@yahoo.com">thoitrangbebo@yahoo.com</a></p>
	           	</div>
	      	</div>
   			<div class="clr"></div>
   		</div>		
 	</div>
 
<?php 
 	$logo = TEMPLATE_URL . '/public/default/images/logo-footer.png';
?>           
            
            
<script type="text/javascript" 
src="http://maps.googleapis.com/maps/api/js?sensor=false&language=en"></script>
<script type="text/javascript">
function getData(data){
	$('#frm-contact div.border_img').html(data);
	return false;
}

function refreshCaptcha(){
	var captchaID = $("#captchaID").val();
	$.get('<?php echo $urlCaptch . '/captchaID/';?>'+captchaID,getData);
}

$(document).ready(function(){
	<?php if(!empty($this->messages[0])):?>
		$('.cnt_note').text('<?php echo $this->messages[0];?>');
		$('.note_popup').slideDown(500).delay(3000).slideUp(500);
	<?php endif;?>

	anchorAnimate('.featured-view');
	
	$('#refresh').click(function(e){
		e.preventDefault();
		refreshCaptcha();
	});
	
	$('a.button').click(function(){
		$('#frm-contact').submit();
		return false;
	})
	initialize();
});

var map;
function initialize() {
    var myLatlng = new google.maps.LatLng(10.808399,106.753249);
    var myOptions = {
    zoom: 15,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("google_map"), myOptions); 
var text;
//text= "<table><tr><td width='200' style='font-family: Calibri;font-size:13px;color: rgb(0, 149, 71)'><strong>LabRoots, Inc.</strong><br />18340 Yorba Linda Blvd.<br />Suite 107 PMB 427 <br />Yorba Linda, CA 92886<br />Phone: 1-714-926-6384<br />Fax: 1-714-463-4673</td></tr></table>";
text= "<table><tr><td><img style='margin-right:10px; width: 203px; height: 72px;' src='<?php echo $logo?>'/></td></tr></table>";
   var infowindow = new google.maps.InfoWindow(
    { content: text,
        size: new google.maps.Size(100,50),
        position: myLatlng
    });
       infowindow.open(map);    
    var marker = new google.maps.Marker({
      position: myLatlng, 
      map: map,
      title:"Beboshop"
  });
}
</script>            